package com.fulihui.systemcore.api;

import com.fulihui.systemcore.condition.PropertiesCondition;
import com.fulihui.systemcore.dto.PropertiesDTO;
import com.fulihui.systemcore.request.prop.PropertiesDeleteRequest;
import com.fulihui.systemcore.request.prop.PropertiesPageRequest;
import com.fulihui.systemcore.request.prop.PropertiesQueryRequest;
import com.fulihui.systemcore.request.prop.PropertiesSaveRequest;
import org.near.servicesupport.request.TRequest;
import org.near.servicesupport.result.BaseResult;
import org.near.servicesupport.result.TMultiResult;
import org.near.servicesupport.result.TPageResult;

/**
 * 属性操作服务接口
 * Created by Willard.Hu on 2016/3/5.
 */
public interface PropertiesService {

    /**
     * 保存属性，有更新，没有则新增，通过prodName和key判断
     * @param request {@link PropertiesSaveRequest}
     * @return 服务调用返回结果 {@link BaseResult}
     */
    BaseResult save(PropertiesSaveRequest request);

    /**
     * 更新属性值
     * @param request {@link PropertiesSaveRequest}
     * @return 服务调用返回结果 {@link BaseResult}
     */
    BaseResult updateValue(PropertiesSaveRequest request);

    /**
     * 删除属性
     * @param request {@link PropertiesDeleteRequest}
     * @return 服务调用返回结果 {@link BaseResult}
     */
    BaseResult delete(PropertiesDeleteRequest request);

    /**
     * 按条件查询属性
     * @param request {@link PropertiesCondition}
     * @return 返回多个属性模型 {@link PropertiesDTO}
     * @see PropertiesService#queryMulti(PropertiesQueryRequest)
     */
    @Deprecated
    TMultiResult<PropertiesDTO> query(TRequest<PropertiesCondition> request);

    /**
     * 按条件查询属性
     * @param request {@link PropertiesQueryRequest}
     * @return 返回多个属性模型 {@link PropertiesDTO}
     */
    TMultiResult<PropertiesDTO> queryMulti(PropertiesQueryRequest request);

    /**
     * 分页查询属性
     * @param request {@link PropertiesPageRequest}
     * @return 返回分页后的属性模型 {@link PropertiesDTO}
     */
    TPageResult<PropertiesDTO> queryPage(PropertiesPageRequest request);
}
